import javax.xml.crypto.Data;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Date;

public class Test {

    public static void main1(String[] args) {
        System.out.println(Math.abs(-12));
        System.out.println(Math.abs(-234));
        System.out.println(Math.abs(-3.23));
        System.out.println(Math.ceil(3.000000000001));
        System.out.println(Math.ceil(3.0));
        System.out.println(Math.floor(3.999));
        System.out.println(Math.floor(3.1));

        System.out.println(Math.round(3.49999));
        System.out.println(Math.round(3.51));
        System.out.println(Math.max(32, 43));
        System.out.println(Math.min(32, 43));
        System.out.println(Math.pow(3, 2));
        System.out.println(Math.pow(2, 3));
        System.out.println(Math.random());
    }

    public static void main2(String[] args) {

        System.out.println("iopjwqejiofwe");
//        System.exit(0);
        System.out.println("afeiwqjoqjiorge");

        long p = System.currentTimeMillis();
        System.out.println(p);
//        Date p1 = new Date(p);
//        System.out.println(p1);

        for (int i = 0; i < 10000000; i++) {
            System.out.println("输出：" + i);
        }
        long p1 = System.currentTimeMillis();
        System.out.println(p1);
        System.out.println((p1 - p) / 1000 + "秒");

    }

    public static void main3(String[] args) throws IOException {

        Runtime r = Runtime.getRuntime();
        System.out.println(r);

//        r.exit(0);

        System.out.println(r.availableProcessors());

        System.out.println(r.totalMemory() / 1024.0 / 1024.0 + "MB");
        System.out.println(r.freeMemory() / 1024.0 / 1024.0 + "MB");

        r.exec("C:\\Users\\彭盛宇\\Downloads\\Xmind-for-Windows-x64bit-24.04.10291-202404282358.exe");

    }

    public static void main(String[] args) {

        BigDecimal a1 = BigDecimal.valueOf(0.1);
        BigDecimal a2 = BigDecimal.valueOf(0.2);
        BigDecimal a3 = a1.add(a2);
        System.out.println(a3);

        BigDecimal b1 = a2.subtract(a1);
        System.out.println(b1);

        BigDecimal b2 = a2.divide(a1);
        System.out.println(b2);

        BigDecimal b3 = a2.multiply(a1);
        System.out.println(b3);

        double p = b3.doubleValue();
        System.out.println(p);
    }
}
